<?php
App::uses('AppModel', 'Model');
/**
 * Question Model
 *
 * @property answer $answer
 * @property questionnaire $questionnaire
 */
class Question extends AppModel {

/**
 * Primary key field
 *
 * @var string
 */
	public $primaryKey = 'questions_id';


	public $validate = array(
        
        'questions' => array( 
            'question_must_be_entered' => array( 
            'rule' => array('notempty'), 
            'message' => 'Please enter a question'), 
       ),
         'comments' => array( 
            'comment_must_be_entered' => array( 
            'rule' => array('notempty'), 
            'message' => 'Please enter a comment'), 
       ),
    );
/**
 * Display field
 *
 * @var string
 */
	public $displayField = 'questions_id';


	//The Associations below have been created with all possible keys, those that are not needed can be removed


/**
 * belongsTo associations
 *
 * @var array
 */
	public $belongsTo = array(
		'questionnaire' => array(
			'className' => 'Questionnaire',
			'foreignKey' => 'q_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
            'answer' => array(
			'className' => 'answer',
			'foreignKey' => 'answers_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
}
